<?php

namespace App\Http\Admin\Controllers\System;
use App\Services\system\SystemLogServices;
use App\Http\Controllers\Controller;
use Hlcreation\Basic\Helper;

/**
 *   操作日志
 * */

class SystemLogController  extends Controller
{
    
    /**
     * @param SystemLogServices $services
     */
    public function __construct(SystemLogServices $services)
    {
        
        $this->services = $services;
    }
    
    /**
     * saas平台日志
     */
    public  function  index(){
        $userInfo = Helper::getPost('userinfo');
        $id=$userInfo['user_info']['id'];
        $where['limit']=  Helper::getPost('limit',20);
        $where['name']=  Helper::getPost('name','');
        $page=Helper::getPost('page', 1);
        $where['page']=$page;
        $where['type']=Helper::getPost('type',1);
        $where['create_time']=Helper::getPost('create_time','');
        $where['user_id']=$id;
        $data=$this->services->LogList($where);
        if($where['type']==2) return $data;
        return Helper::toJson("操作日志列表", 200, $data);
    }
    
}
    